/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package VIEW;

import MODEL.dangnhap_Model;
import javax.swing.JMenu;

/**
 *
 * @author CONGTHANH
 */
public class Main extends javax.swing.JFrame{// implements NewInterface {

    /**
     * Creates new form Main
     */
    public Main() {
        initComponents();
    }
                       

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
   
//    @Override
    public JMenu getjmn2(){
        return this.mnql;
    }
    public JMenu getjmn3(){
       
        return this.mntk;
    }
    public JMenu getjmn4(){
        return this.mntg;
    }
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenu1 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();
        jMenu3 = new javax.swing.JMenu();
        jMenu4 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jPopupMenu1 = new javax.swing.JPopupMenu();
        DesPane1 = new javax.swing.JDesktopPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        mnht = new javax.swing.JMenu();
        jmndn = new javax.swing.JMenuItem();
        jmndx = new javax.swing.JMenuItem();
        mnql = new javax.swing.JMenu();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        mntk = new javax.swing.JMenu();
        jMenuItem5 = new javax.swing.JMenuItem();
        mntg = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();

        jMenu1.setText("jMenu1");

        jMenu2.setText("jMenu2");

        jMenu3.setText("jMenu3");

        jMenu4.setText("jMenu4");

        jMenuItem1.setText("jMenuItem1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(0, 255, 204));

        DesPane1.setBackground(new java.awt.Color(204, 204, 255));
        DesPane1.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
            public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
                DesPane1MouseWheelMoved(evt);
            }
        });
        DesPane1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                DesPane1MouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                DesPane1MouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                DesPane1MouseExited(evt);
            }
        });
        DesPane1.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentHidden(java.awt.event.ComponentEvent evt) {
                DesPane1ComponentHidden(evt);
            }
            public void componentMoved(java.awt.event.ComponentEvent evt) {
                DesPane1ComponentMoved(evt);
            }
            public void componentResized(java.awt.event.ComponentEvent evt) {
                DesPane1ComponentResized(evt);
            }
            public void componentShown(java.awt.event.ComponentEvent evt) {
                DesPane1ComponentShown(evt);
            }
        });
        DesPane1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                DesPane1MouseDragged(evt);
            }
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                DesPane1MouseMoved(evt);
            }
        });
        DesPane1.addContainerListener(new java.awt.event.ContainerAdapter() {
            public void componentAdded(java.awt.event.ContainerEvent evt) {
                DesPane1ComponentAdded(evt);
            }
            public void componentRemoved(java.awt.event.ContainerEvent evt) {
                DesPane1ComponentRemoved(evt);
            }
        });
        DesPane1.addHierarchyBoundsListener(new java.awt.event.HierarchyBoundsListener() {
            public void ancestorMoved(java.awt.event.HierarchyEvent evt) {
                DesPane1AncestorMoved1(evt);
            }
            public void ancestorResized(java.awt.event.HierarchyEvent evt) {
                DesPane1AncestorResized(evt);
            }
        });
        DesPane1.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                DesPane1FocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                DesPane1FocusLost(evt);
            }
        });
        DesPane1.addHierarchyListener(new java.awt.event.HierarchyListener() {
            public void hierarchyChanged(java.awt.event.HierarchyEvent evt) {
                DesPane1HierarchyChanged(evt);
            }
        });
        DesPane1.addInputMethodListener(new java.awt.event.InputMethodListener() {
            public void caretPositionChanged(java.awt.event.InputMethodEvent evt) {
                DesPane1CaretPositionChanged(evt);
            }
            public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {
                DesPane1InputMethodTextChanged(evt);
            }
        });
        DesPane1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                DesPane1PropertyChange(evt);
            }
        });
        DesPane1.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                DesPane1AncestorMoved(evt);
            }
            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
                DesPane1AncestorAdded(evt);
            }
            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
                DesPane1AncestorRemoved(evt);
            }
        });
        DesPane1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                DesPane1KeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                DesPane1KeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                DesPane1KeyTyped(evt);
            }
        });
        DesPane1.addVetoableChangeListener(new java.beans.VetoableChangeListener() {
            public void vetoableChange(java.beans.PropertyChangeEvent evt)throws java.beans.PropertyVetoException {
                DesPane1VetoableChange(evt);
            }
        });

        mnht.setText("Hệ Thống");

        jmndn.setText("Đăng Nhập");
        jmndn.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                jmndnMouseMoved(evt);
            }
        });
        jmndn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmndnActionPerformed(evt);
            }
        });
        mnht.add(jmndn);

        jmndx.setText("Đăng Xuất");
        jmndx.setEnabled(false);
        jmndx.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmndxActionPerformed(evt);
            }
        });
        mnht.add(jmndx);

        jMenuBar1.add(mnht);

        mnql.setText("Quản Lý");

        jMenuItem3.setText("Sinh Viên");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        mnql.add(jMenuItem3);

        jMenuItem4.setText("Môn Học");
        mnql.add(jMenuItem4);

        jMenuBar1.add(mnql);

        mntk.setText("Quản Lý Tìm Kiếm");
        mntk.setEnabled(false);

        jMenuItem5.setText("Tìm Sinh Viên");
        mntk.add(jMenuItem5);

        jMenuBar1.add(mntk);

        mntg.setText("Trợ Giúp");
        mntg.setEnabled(false);

        jMenuItem2.setText("Hướng Dẩn Sử Dụng");
        mntg.add(jMenuItem2);

        jMenuBar1.add(mntg);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(DesPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 773, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(DesPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 446, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
  frmdangnhap f=new frmdangnhap();
    private void jmndnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmndnActionPerformed
        // TODO add your handling code here:
       
        this.DesPane1.add(f);
        f.setVisible(true);
            
        
    }//GEN-LAST:event_jmndnActionPerformed
   
    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        // TODO add your handling code here:
                                                  
        frmSinhVien f=new frmSinhVien();
        f.setVisible(true);
        this.dispose();
      
    }//GEN-LAST:event_jMenuItem3ActionPerformed
  
    private void jmndxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmndxActionPerformed
        // TODO add your handling code here:
        dangnhap_Model fdn=new dangnhap_Model();
         if(fdn.getkqdn()==true ){
            this.jmndn.setEnabled(true);
             this.jmndx.setEnabled(false);
             //this.mnht.setEnabled(false);
             this.mnql.setEnabled(false);
             this.mntk.setEnabled(false);
          
             
             //dong all
            for(int i=0;i<this.DesPane1.getAllFrames().length;i++)
                this.DesPane1.getAllFrames()[i].setVisible(false);
            //
            fdn.setkqdn(); //trang thai chua dang nhap
            f.setVisible(true);
            f.khoitao();//rong textbox
         }
    }//GEN-LAST:event_jmndxActionPerformed

    private void DesPane1AncestorRemoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_DesPane1AncestorRemoved
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1AncestorRemoved

    private void DesPane1AncestorResized(java.awt.event.HierarchyEvent evt) {//GEN-FIRST:event_DesPane1AncestorResized
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1AncestorResized

    private void DesPane1CaretPositionChanged(java.awt.event.InputMethodEvent evt) {//GEN-FIRST:event_DesPane1CaretPositionChanged
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1CaretPositionChanged

    private void DesPane1ComponentAdded(java.awt.event.ContainerEvent evt) {//GEN-FIRST:event_DesPane1ComponentAdded
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1ComponentAdded

    private void DesPane1ComponentHidden(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_DesPane1ComponentHidden
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1ComponentHidden

    private void DesPane1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_DesPane1MouseClicked
        // TODO add your handling code here:
        
       
    }//GEN-LAST:event_DesPane1MouseClicked

    private void DesPane1MouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_DesPane1MouseDragged
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1MouseDragged

    private void DesPane1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_DesPane1MouseExited
        // TODO add your handling code here:
      
    }//GEN-LAST:event_DesPane1MouseExited

    private void DesPane1AncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_DesPane1AncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1AncestorMoved

    private void DesPane1ComponentMoved(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_DesPane1ComponentMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1ComponentMoved

    private void DesPane1AncestorMoved1(java.awt.event.HierarchyEvent evt) {//GEN-FIRST:event_DesPane1AncestorMoved1
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1AncestorMoved1

    private void DesPane1AncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_DesPane1AncestorAdded
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1AncestorAdded

    private void DesPane1ComponentRemoved(java.awt.event.ContainerEvent evt) {//GEN-FIRST:event_DesPane1ComponentRemoved
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1ComponentRemoved

    private void DesPane1ComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_DesPane1ComponentResized
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1ComponentResized

    private void DesPane1ComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_DesPane1ComponentShown
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1ComponentShown

    private void DesPane1FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_DesPane1FocusGained
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1FocusGained

    private void DesPane1FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_DesPane1FocusLost
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1FocusLost

    private void DesPane1HierarchyChanged(java.awt.event.HierarchyEvent evt) {//GEN-FIRST:event_DesPane1HierarchyChanged
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1HierarchyChanged

    private void DesPane1InputMethodTextChanged(java.awt.event.InputMethodEvent evt) {//GEN-FIRST:event_DesPane1InputMethodTextChanged
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1InputMethodTextChanged

    private void DesPane1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_DesPane1KeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1KeyPressed

    private void DesPane1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_DesPane1KeyReleased
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1KeyReleased

    private void DesPane1KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_DesPane1KeyTyped
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1KeyTyped

    private void DesPane1MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_DesPane1MouseEntered
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1MouseEntered

    private void DesPane1PropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_DesPane1PropertyChange
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1PropertyChange

    private void DesPane1VetoableChange(java.beans.PropertyChangeEvent evt)throws java.beans.PropertyVetoException {//GEN-FIRST:event_DesPane1VetoableChange
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1VetoableChange

    private void DesPane1MouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_DesPane1MouseWheelMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_DesPane1MouseWheelMoved

    private void DesPane1MouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_DesPane1MouseMoved
        // TODO add your handling code here:
         dangnhap_Model fdn=new dangnhap_Model();
           if(fdn.getkqdn()==true){
            this.jmndn.setEnabled(false);
             this.jmndx.setEnabled(true);
             //this.mnht.setEnabled(true);
             this.mnql.setEnabled(true);
             this.mntk.setEnabled(true);
        }
       
    }//GEN-LAST:event_DesPane1MouseMoved

    private void jmndnMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jmndnMouseMoved
        // TODO add your handling code here:
     
    }//GEN-LAST:event_jmndnMouseMoved

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Main().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane DesPane1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JPopupMenu jPopupMenu1;
    private javax.swing.JMenuItem jmndn;
    private javax.swing.JMenuItem jmndx;
    private javax.swing.JMenu mnht;
    private javax.swing.JMenu mnql;
    private javax.swing.JMenu mntg;
    private javax.swing.JMenu mntk;
    // End of variables declaration//GEN-END:variables
}
